/**
 * 上海中赢金融信息服务有限公司
 * Copyright (c) 2017-2027 Chinazyjr,Inc.All Rights Reserved.
 */
package com.sys.midware.hbase.hcore.Optimize;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.apache.hadoop.hbase.client.Durability;
import org.apache.hadoop.hbase.io.compress.Compression.Algorithm;
import org.apache.hadoop.hbase.regionserver.BloomType;

import com.sys.midware.hbase.hcore.Optimize.OprimzeParam.WAL;
import com.sys.midware.hbase.hcore.filter.HbaseFilterFactory.CompareOp;

/**
 * hbase映射
 * <b>ClassName：</b> HbaseMappingPool <br/>
 * <b>Description：</b> TODO <br/>
 * <b>@author：</b> mobing <br/>
 * <b>@date：</b> 2015年10月26日 下午7:28:03 <br/>
 * <b>@version: </b>  <br/>
 */
final public class HbaseMappingPool {
	
	public static Map<OprimzeParam.BloomType,BloomType> map_bloom=new HashMap<OprimzeParam.BloomType,BloomType>(3); 
	
	public static Map<OprimzeParam.CompressionAlgorithm,Algorithm> map_compression=new HashMap<OprimzeParam.CompressionAlgorithm,Algorithm>(5);
	//表优化
	public static Map<String,TableOptimize> map_tableOptimization=new HashMap<String,TableOptimize>();
	
	public static Map<WAL,Durability> map_wal=new ConcurrentHashMap<WAL,Durability>();
	
	public static Map<CompareOp,org.apache.hadoop.hbase.filter.CompareFilter.CompareOp> compareOpMap
	=new HashMap<CompareOp,org.apache.hadoop.hbase.filter.CompareFilter.CompareOp>();
	
	static{
		compareOpMap.put(CompareOp.EQUAL, org.apache.hadoop.hbase.filter.CompareFilter.CompareOp.EQUAL);
		compareOpMap.put(CompareOp.GREATER,org.apache.hadoop.hbase.filter.CompareFilter.CompareOp.GREATER);
		compareOpMap.put(CompareOp.GREATER_OR_EQUAL,org.apache.hadoop.hbase.filter.CompareFilter.CompareOp.GREATER_OR_EQUAL);
		compareOpMap.put(CompareOp.LESS,org.apache.hadoop.hbase.filter.CompareFilter.CompareOp.LESS);
		compareOpMap.put(CompareOp.LESS_OR_EQUAL,org.apache.hadoop.hbase.filter.CompareFilter.CompareOp.LESS_OR_EQUAL);
		compareOpMap.put(CompareOp.NO_OP,org.apache.hadoop.hbase.filter.CompareFilter.CompareOp.NO_OP);
		compareOpMap.put(CompareOp.NOT_EQUAL,org.apache.hadoop.hbase.filter.CompareFilter.CompareOp.NOT_EQUAL);
		
		map_bloom.put(OprimzeParam.BloomType.NONE, BloomType.NONE);
		map_bloom.put(OprimzeParam.BloomType.ROW, BloomType.ROW);
		map_bloom.put(OprimzeParam.BloomType.ROWCOL, BloomType.ROWCOL);
		//
		map_compression.put(OprimzeParam.CompressionAlgorithm.GZ, Algorithm.GZ);
		map_compression.put(OprimzeParam.CompressionAlgorithm.LZ, Algorithm.LZ4);
		map_compression.put(OprimzeParam.CompressionAlgorithm.LZO,Algorithm.LZO);
		map_compression.put(OprimzeParam.CompressionAlgorithm.NONE,Algorithm.NONE);
		map_compression.put(OprimzeParam.CompressionAlgorithm.SNAPPY,Algorithm.SNAPPY);
		//
		map_wal.put(WAL.USE_DEFAULT, Durability.USE_DEFAULT);
		map_wal.put(WAL.SKIP_WAL,Durability.SKIP_WAL);
		map_wal.put(WAL.ASYNC_WAL,Durability.ASYNC_WAL);
		map_wal.put(WAL.SYNC_WAL,Durability.SYNC_WAL);
		map_wal.put(WAL.FSYNC_WAL,Durability.FSYNC_WAL);
	}
	

}
